diff --git a/setup.py b/setup.py
index a427d5493..d29c9a338 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ install_requires = [
     'sphinxcontrib-htmlhelp',
     'sphinxcontrib-serializinghtml',
     'sphinxcontrib-qthelp',
-    'Jinja2>=2.3',
+    'Jinja2<3.1',
     'Pygments>=2.0',
     'docutils>=0.12',
     'snowballstemmer>=1.1',
diff --git a/sphinx/roles.py b/sphinx/roles.py
index 57d11c269..28eb2df90 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -458,7 +458,7 @@ def emph_literal_role(typ: str, rawtext: str, text: str, lineno: int, inliner: I
 
 
 class EmphasizedLiteral(SphinxRole):
-    parens_re = re.compile(r'(\\\\|\\{|\\}|{|})')
+    parens_re = re.compile(r'(\\\\+|\\{|\\}|{|})')
 
     def run(self) -> Tuple[List[Node], List[system_message]]:
         children = self.parse(self.text)
@@ -472,8 +472,11 @@ class EmphasizedLiteral(SphinxRole):
 
         stack = ['']
         for part in self.parens_re.split(text):
-            if part == '\\\\':  # escaped backslash
-                stack[-1] += '\\'
+            if part.startswith('\\\\'):  # escaped backslashes
+                num_backslashes = len(part)
+                # According to RST spec, "\\" becomes "\", "\\\" becomes "\\", and so on
+                # So we divide by 2 the number of backslashes to render the correct amount
+                stack[-1] += '\\' * (num_backslashes // 2)
             elif part == '{':
                 if len(stack) >= 2 and stack[-2] == "{":  # nested
                     stack[-1] += "{"
diff --git a/tox.ini b/tox.ini
index d9f040544..bf39854b6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -28,7 +28,7 @@ extras =
 setenv =
     PYTHONWARNINGS = all,ignore::ImportWarning:importlib._bootstrap_external,ignore::DeprecationWarning:site,ignore::DeprecationWarning:distutils
 commands=
-    pytest --durations 25 {posargs}
+    pytest -rA --durations 25 {posargs}
 
 [testenv:flake8]
 basepython = python3
